home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / gfxprograms / 3dprograms / rayshade-4.0 / unapplied / fix015.shadow-attenuation next >
Internet Message Format  |  1995-02-13  |  3KB

  1. From theseas!fs.Princeton.EDU!cek Tue, 27 Jul 93 01:36:59 EET
  2. Received: by kriton.UUCP (V1.16/Amiga)
  3.     id AA00000; Tue, 27 Jul 93 01:36:59 EET
  4. Received: by theseas.ntua.gr with UUCP; Mon, 26 Jul 93 11:32:49 +0300
  5. Received: from mcsun.EU.net by pythia.ics.forth.gr via ITEnet with SMTP;
  6.     id AA23349 (5.65c/FORTH-ICS-3.0-MHS-7.0); Mon, 26 Jul 1993 11:10:22 +0300
  7. Received: by mcsun.EU.net with UUCP
  8.     id AA16480 (5.65b/CWI-2.220); Mon, 26 Jul 1993 10:09:08 +0200
  9. Received: from Princeton.EDU by relay2.UU.NET with SMTP 
  10.     (5.61/UUNET-internet-primary) id AB24006; Mon, 26 Jul 93 04:08:20 -0400
  11. Received: from fs.Princeton.EDU by Princeton.EDU (5.65b/2.97/princeton)
  12.     id AA28530; Mon, 26 Jul 93 04:05:27 -0400
  13. Received: by fs.Princeton.EDU (4.1/1.105)
  14.     id AA03176; Mon, 26 Jul 93 04:05:26 EDT
  15. Received: from fsa.cpsc.ucalgary.ca by fs.Princeton.EDU (4.1/1.105)
  16.     id AA03094; Mon, 26 Jul 93 04:04:39 EDT
  17. Received: from fsd.cpsc.ucalgary.ca by fsa.cpsc.ucalgary.ca (4.1/CSd1.2)
  18.     id <AA03696@fsa.cpsc.ucalgary.ca>; Mon, 26 Jul 93 02:02:04 MDT
  19. Received: by fsd.cpsc.ucalgary.ca (5.67/cs1.0)
  20.     id AA28555; Mon, 26 Jul 93 02:02:11 -0600
  21. Date: Mon, 26 Jul 93 02:02:11 -0600
  22. Message-Id: <9307260802.AA28555@fsd.cpsc.ucalgary.ca>
  23. Errors-To: Princeton.EDU!cek
  24. Remailed-Date: Mon Jul 26 04:04:42 EDT 1993
  25. From: cpsc.ucalgary.ca!jamesm (Mark James)
  26. To: Rayshade Mailing List <cs.Princeton.EDU!rayshade-users>
  27. Subject: ligthing models
  28.  
  29.  
  30. Since quite a few people have asked for my shadow attenuation
  31. patches, and they're quite small, I'll just send them to everyone...
  32.  
  33. Currently the only way to change the parameter "ts" is to change the
  34. code. :) The Graphics Gems article says:
  35.     Setting ts = 0.6 works well in most cases.
  36.  
  37.      M.
  38.  
  39. --------- Cut Here ------------------
  40. *** ./libray/liblight/shadow.c    Sun Feb  9 20:04:06 1992
  41. --- ../caustics/./libray/liblight/shadow.c    Tue Feb 23 20:43:11 1993
  42. ***************
  43. *** 63,68 ****
  44. --- 63,70 ----
  45.       Surface surf, *sptr, *prevsurf;
  46.       Float s, totaldist, statten;
  47.       Color res;
  48. +     double ts=0.6;
  49. +     double tm;
  50.   
  51.       if (noshadow || NOSHADOWS(ShadowOptions)) {
  52.           *result = *color;
  53. ***************
  54. *** 196,205 ****
  55.               prevsurf = &surf;
  56.           else
  57.               prevsurf = (Surface *)NULL;
  58.           /*
  59.            * Attenuate light source by body color of surface.
  60.            */
  61. !         ColorScale(surf.transp, res, &res);
  62.           ColorMultiply(res, surf.body, &res);
  63.           /*
  64.            * Return if attenuation becomes large.
  65. --- 198,210 ----
  66.               prevsurf = &surf;
  67.           else
  68.               prevsurf = (Surface *)NULL;
  69. +         
  70. +         VecNormalize( &norm );
  71. +         tm=1+fabs(dotp(&norm,&(ray->dir))*ts);
  72.           /*
  73.            * Attenuate light source by body color of surface.
  74.            */
  75. !         ColorScale(surf.transp*tm, res, &res);
  76.           ColorMultiply(res, surf.body, &res);
  77.           /*
  78.            * Return if attenuation becomes large.
  79. --------- Cut Here ------------------
  80.  
  81.  
  82. ----------
  83. Administrivia: rayshade-request@cs.princeton.edu
  84. Mailing list: rayshade-users@cs.princeton.edu
  85.  
  86.